# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=soapui
_pkgname=SoapUI
pkgver=5.8.0
pkgrel=1
pkgdesc='The Swiss-Army Knife for SOAP Testing.'
groups=('blackarch' 'blackarch-proxy' 'blackarch-fuzzer')
arch=('x86_64')
url='https://www.soapui.org/downloads/soapui/source-forge.html'
license=('custom:unknown')
depends=('java-environment')
makedepends=('git')
source=("https://dl.eviware.com/soapuios/$pkgver/$_pkgname-$pkgver-linux-bin.tar.gz")
sha512sums=('0e8e098a516b352da9205306373c2a88d1784f227ba8363b9e407102c8bfa3e7ffb5a97a9c2a3c575d97425ce6fc223ad7e9b363e81e4e4f33d4451d2a83bc0e')

package() {
  cd "$_pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md RELEASENOTES.txt
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm README.md RELEASENOTES.txt LICENSE.txt

  cp -a * "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec sh /usr/share/$pkgname/bin/$pkgname.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

